<template>
	<view class="wrapper" @click="toDetail">
		<view class="left">
			<u-image width="90%" height="100%" :src="baseUrl+'/imgs/uniapp2.png'"></u-image>
		</view>

		<view class="right">
			<view class="title">{{item.title}}</view>
			<view class="info">
				<text class="date">2023-05-19</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"

	export default {
		name: "question-item",
		props: ["item"],

		data() {
			return {

			};
		},

		computed: mapState([
			"baseUrl"
		]),

		methods: {
			toDetail(e) {
				console.log("toDetail,item=", this.item);
				uni.navigateTo({
					url: `/pages/detail/detail?href=${this.item.href}&video=${this.item.video}&title=${this.item.title}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrapper {
		display: flex;
		height: 200rpx;
		padding: 15rpx 20rpx;
		border-bottom: 1px solid #f0f0f0;

		.left {
			width: 180rpx;
			margin-right: 5rpx;
			// display: flex;
			// align-items: center;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			.title {
				line-height: 1.4rem;
				color: #333;
			}

			.info {
				display: flex;
				justify-content: flex-end;

				.date {
					color: #ccc;
					font-size: .8rem;
				}
			}
		}

	}
</style>